// 导入路由组件
import Vue from 'vue'
import Router from 'vue-router'

// 注册路由
Vue.use(Router)

// 创建路由
export default new Router({
  routes: [
    // {
    //   path: '/',
    //   component: require('@/components/LandingPage').default
    // },
    // {
    //   path: '*',
    //   redirect: '/'
  // }
    {
        path: '*',
        redirect: '/'
    },
	  {
      path: '/',
      name: 'login',
      component: resolve => require(['../views/login'], resolve).default
	  },
    {
      path: '/homes',
      name: 'homes',
      component: resolve => require(['../views/homes'], resolve),
      children:[
        {
          path: '/adminaccountlist', // 管理者账号列表
          name: 'adminaccountlist',
          component: resolve => require(['../views/homes/adminaccountlist'],resolve)
        },
        {
          path: '/companys',  //中介公司管理列表
          name: 'companys',
          component: resolve => require(['../views/homes/companys'], resolve),
        },
        {
          path: '/type',  //分类管理列表
          name: 'type',
          component: resolve => require(['../views/homes/type'], resolve),
        },
        {
          path: '/leveltype',  //三级分类管理
          name: 'leveltype',
          component: resolve => require(['../views/homes/leveltype'], resolve),
        },
        {
          path: '/articlelist',  //文章管理列表
          name: 'articlelist',
          component: resolve => require(['../views/homes/articlelist'], resolve),
        },
        {
          path: '/leveltypelist',  //二级分类管理列表
          name: 'leveltypelist',
          component: resolve => require(['../views/homes/leveltypelist'], resolve),
        },
        {
          path: '/last_leveltypelist',  //三级分类管理
          name: 'last_leveltypelist',
          component: resolve => require(['../views/homes/last_leveltypelist'], resolve),
        },
        {
          path: '/module',  //权限管理-模块
          name: 'module',
          component: resolve => require(['../views/management/module'], resolve),
        },
        {
          path: '/authority',  //权限管理-权限
          name: 'authority',
          component: resolve => require(['../views/management/authority'], resolve),
        }

      ]
    }
  ]
})
